<template>
  <div>
    <div>
      <el-row style="margin-bottom:10px">
        <el-col :span="8" >
          <h4 style="margin:0">
            <span>医生审核</span>
          </h4>
        </el-col>
      </el-row>

      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="全部" name="first">
          <my-doctor v-if="navStatus == -1" :navStatus="navStatus" ref="children" ></my-doctor>
        </el-tab-pane>

        <el-tab-pane label="待审核" name="second">
          <my-doctor v-if="navStatus == 0" :navStatus="navStatus" ref="children" ></my-doctor>
        </el-tab-pane>
      </el-tabs>

    </div>
  </div>
</template>

<script>
  import Http from '@/Http/Http'
  import getTime from '@/Http/getTime'
  import myDoctor from './myDoctor'
  export default {
    data() {
      return {
        userRole:JSON.parse(sessionStorage.getItem('userSolt')),
        navStatus:-1,
        activeName: 'first',
        result_msg:'',
        dataPush:'',
        id:'',
        total:0,
        currentPage4: 1,//分野  
        page:1,
        pageSize:10,
        tableData: []
      }
    },
    
    components:{
      myDoctor
    },
     mounted() {
      var obj = document.getElementById('centerbox')
      obj.addEventListener('scroll', this.handleScroll,true)
    },
    destroyed(){
      var obj = document.getElementById('centerbox')
      obj.removeEventListener('scroll', this.handleScroll,true)
    },
    methods: {
      handleScroll() {
        var scollobj = document.getElementById('centerbox');
        var scrollTop = scollobj.scrollTop;
        const obj = document.getElementById('tab-first');
        const myobj = obj.parentNode.parentNode;
        if(scrollTop> 32){
          myobj.style.position = 'fixed';
          myobj.style.top = 0;
        } else {
          myobj.style.position = 'relative';
        }
      },
      
      
      handleClick(tab) {
        this.navStatus = Number(tab.index)-1;
      },
    }
  }
</script>
<style  scoped>
.box{
  border-bottom:1px solid red;
}
    .test{
        border:1px solid #ccc;
    }
    .drag-item{
        width: 200px;
        height: 50px;
        line-height: 50px;
        margin: auto;
        position: relative;
        
        background: #ddd;
        margin:20px 5px;
    }
    .ghostClass{
        opacity: 1;
    }
    .bottom{
        width: 200px;
        height: 50px;
        position: relative;
        background: blue;
        top:2px;
        left: 2px;
        transition: all .5s linear;
    }
</style>
